import axios from 'axios'
import axiosUtil from '../base/axiosUtil'
import apiConfig from '../config/apiConfig'
import { getterMenus, getUserInfo } from '../../mock'

function request(method, url, data) {
    return new Promise((resolve, reject) => {
        axiosUtil[method](url, data, (res) => {
            resolve(res)
        })
    })
}

// 获取菜单列表
export function getterMenusMock() {
    return new Promise((resolve, reject) => {
        let menuList = getterMenus()
        resolve(menuList)
    })
}

// 获取用户信息
export function getUserInfoMock() {
    return new Promise((resolve, reject) => {
        let userInfo = getUserInfo()
        resolve(userInfo)
    })
}

